<!--
 * @Descripttion: 
 * @version: 
 * @Author: zhangchongjie
 * @Date: 2022-06-20 09:35:38
 * @LastEditors: zhangchongjie
 * @LastEditTime: 2022-06-21 16:34:46
 * @FilePath: \workspace-y9boot-9.5-vuee:\workspace-y9boot-9.6-vue\y9vue-kernel-dcat-style\src\views\org\comps\dialogContent\sync.vue
-->
<template>
	<!-- 数据同步 -->
	<el-form ref="formRef" :model="formData" :rules="rules" :inline-message='true'>
		<el-descriptions class="margin-top" border column="1">
			<el-descriptions-item :label="$t('目标系统标识')">
				<el-form-item prop="targetSysName" required :size="fontSizeObj.buttonSize"   >
					<el-select v-model="formData.targetSysName" :placeholder="$t('请选择')">
						<el-option label="ALL" value="ALL" :style="{ fontSize: fontSizeObj.baseFontSize }"/>
						<el-option label="sync-all-persons" value="sync-all-persons" :style="{ fontSize: fontSizeObj.baseFontSize }" />
						<el-option label="sync-all-departments" value="sync-all-departments" :style="{ fontSize: fontSizeObj.baseFontSize }" />
					</el-select>
				</el-form-item>
			</el-descriptions-item>
			<el-descriptions-item :label="$t('是否递归')">
				<el-form-item prop="needRecursion" :size="fontSizeObj.buttonSize">
					<el-radio-group v-model="formData.needRecursion">
						<el-radio :label="1">{{ $t('是') }}</el-radio>
						<el-radio :label="0">{{ $t('否') }}</el-radio>
					</el-radio-group>
				</el-form-item>
			</el-descriptions-item>
		</el-descriptions>
	</el-form>
</template> 

<script lang="ts" setup>
import { useI18n } from "vue-i18n"
import { sync } from '@/api/org/index';
import { ref, reactive, inject, watch } from 'vue';
// 注入 字体对象
const fontSizeObj: any = inject('sizeObjInfo');
const { t } = useI18n();
const data = reactive({
	formData: {
		targetSysName: "",
		needRecursion: 0,
	},
	formRef: '',
	rules: { targetSysName: { required: true, message: t('请选择目标系统标识'), trigger: 'change' } }
})
let {
	formData,
	formRef,
	rules
} = toRefs(data)

defineExpose({
	formData,
	validForm
})


async function validForm() {
	
	return new Promise((resolve) => {
		
		formRef.value?.validate(valid => {
			resolve(valid)
		});
	})
	
};
</script>

<style>
</style>